package com.chenyue.cm.account.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 金币记录
 * </p>
 *
 * @author ljy
 * @since 2021-08-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "JdAccountRecord对象", description = "金币记录")
public class JdAccountRecord extends Model<JdAccountRecord> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "用户id")
    private Integer userId;

    @ApiModelProperty(value = "变动类型1支出2收入")
    private Integer changeType;

    @ApiModelProperty(value = "金额")
    private Double amount;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date ct;

    @ApiModelProperty(value = "订单id")
    private Integer orderId;

    @ApiModelProperty(value = "备注/为比赛收款时-数据=赛事详情json")
    private String remark;

    @ApiModelProperty(value = "变动来源")
    private Integer source;

    @ApiModelProperty(value = "是否有效")
    private Integer status;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
